<?php
//TODO: add generator for ARDataAggregator

$myDir = dirname(__FILE__) . "/";
require_once($myDir."../autoload.php");
if ( $argc == 1 || $argv[1] == "--help" ) {
  die( "\n\tUsage: php ".$argv[0]." [DBAggregator_Name] [PATH_TO_PROJECT]\n\n");  
}

$agrName = $argv[1];
$path    = $argv[2];
$agrToken = "__CLASS_NAME__";

$tpl = file_get_contents($myDir."data_aggregator.dry");
$newAgr = str_replace($agrToken, $agrName, $tpl);

file_put_contents($path."data_aggregators/".$agrName.".php", $newAgr);
WebUtils::addClassToGenAutoload($agrName, $path, "data_aggregators/");